home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / MacShell / IdleTasks.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-04  |  1.9 KB  |  112 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:        MacShell
  5. ** File:        idletasks.c
  6. ** Written by:  Eric Soldan
  7. **
  8. ** Copyright © 1990-1991 Apple Computer, Inc.
  9. ** All rights reserved.
  10. */
  11.  
  12.  
  13.  
  14. /*****************************************************************************/
  15.  
  16.  
  17.  
  18. #include "MacShell.h"            /* Get the MacShell includes/typedefs, etc.    */
  19. #include "MacShellCommon.h"        /* Get the stuff in common with rez.        */
  20. #include "MacShell.protos"        /* Get the prototypes for MacShell.            */
  21.  
  22. #ifndef __NOTIFICATION__
  23. #include <Notification.h>
  24. #endif
  25.  
  26. #ifndef __RESOURCES__
  27. #include <Resources.h>
  28. #endif
  29.  
  30. #ifdef THINK_C
  31. #include "Utilities.h"
  32. #else
  33. #ifndef __UTILITIES__
  34. #include <Utilities.h>
  35. #endif
  36. #endif
  37.  
  38.  
  39.  
  40. /*****************************************************************************/
  41.  
  42.  
  43.  
  44. static Boolean        notifyActive = false;
  45. static NMRec        notifyTheUser = {
  46.     nil,        /* qLink */
  47.     nmType,        /* qType */
  48.     0,            /* nmFlags */
  49.     0L,            /* nmPrivate */
  50.     0,            /* nmReserved */
  51.     1,            /* nmMark */
  52.     nil,        /* nmIcon */
  53.     (Handle)-1,    /* nmSound */
  54.     nil,        /* nmStr */
  55.     nil,        /* nmResp */
  56.     0L            /* nmRefCon */
  57. };
  58.  
  59. extern RgnHandle    gCursorRgn;
  60.  
  61.  
  62.  
  63. /*****************************************************************************/
  64. /*****************************************************************************/
  65.  
  66.  
  67.  
  68. #pragma segment Main
  69. void    DoIdleTasks(EventRecord *event)
  70. {
  71. #pragma unused (event)
  72.  
  73.     DynamicBalloonHelp();
  74. }
  75.  
  76.  
  77.  
  78. /*****************************************************************************/
  79.  
  80.  
  81.  
  82. #pragma segment Main
  83. void    NotifyCancel(void)
  84. {
  85.     if (notifyActive) {
  86.         NMRemove((NMRecPtr)¬ifyTheUser);
  87.         notifyActive = false;
  88.     }
  89. }
  90.  
  91.  
  92.  
  93.  
  94. /*****************************************************************************/
  95.  
  96.  
  97.  
  98. #pragma segment Main
  99. void    NotifyUser(void)
  100. {
  101.     if (gInBackground) {
  102.         if (!notifyActive) {
  103.             notifyTheUser.nmIcon = GetResource('SICN', 128);
  104.             NMInstall(¬ifyTheUser);
  105.             notifyActive = true;
  106.         }
  107.     }
  108. }
  109.  
  110.  
  111.  
  112.